package com.tczs.client.bean;

import java.util.List;

/**
 * 查询条件
 */
public class Where {

    private WhereEnum whereEnum;
    private String name;
    private Object param;
    private Long num; //limit数量
    private List<Object> inParam;
    private Where where;

    /**
     * 集合
     * @param name
     * @param data
     * @return
     */
    public Where IN(String name,List<Object> data){
        this.whereEnum = WhereEnum.IN;
        this.name = name;
        this.inParam = data;
        this.where = new Where();
        return this.where;
    }

    /**
     * 从哪条开始
     * @param num
     * @return
     */
    public Where START(Long num){
        this.whereEnum = WhereEnum.START;
        this.num = num;
        this.where = new Where();
        return this.where;
    }

    /**
     * 限制条数
     * @param num
     * @return
     */
    public Where LIMIT(Long num){
        this.whereEnum = WhereEnum.LIMIT;
        this.num = num;
        this.where = new Where();
        return this.where;
    }

    /**
     * 普通
     * @param name
     * @param data
     * @return
     */
    public Where common(String name,Object data){
        this.whereEnum = WhereEnum.COMMON;
        this.name = name;
        this.param = data;
        this.where = new Where();
        return this.where;
    }

    public WhereEnum getWhereEnum() {
        return whereEnum;
    }

    public String getName() {
        return name;
    }

    public Object getParam() {
        return param;
    }

    public List<Object> getInParam() {
        return inParam;
    }

    public Long getNum() {
        return num;
    }

    public Where getWhere() {
        return where;
    }

    public void setWhereEnum(WhereEnum whereEnum) {
        this.whereEnum = whereEnum;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setParam(Object param) {
        this.param = param;
    }

    public void setNum(Long num) {
        this.num = num;
    }

    public void setInParam(List<Object> inParam) {
        this.inParam = inParam;
    }

    public void setWhere(Where where) {
        this.where = where;
    }
}
